Initial Questions to Explore

How difficult is it to get a license for each unit and season?

NOTICE I will initially ignore the differences between resident, nonresident and youth statuses. I will also ignore the amount of preference points used when applying for a license in the draw.

Setup

setwd("~/_code/colorado-dow/Phase I - Descriptive Analytics")

Load required libraries for wrangling data, charting, and mapping

library(plyr,quietly = T)
library(dplyr,quietly = T)
library(ggplot2, quietly = T)
library(scales, quietly = T)

Set our preferred charting theme

theme_set(theme_minimal())

Run script to get draw data

source('~/_code/colorado-dow/datasets/Elk Drawing Summaries.R', echo=F)

Table of the data

COElkDrawAll2

Statewide Elk Hunter Success

By Year

First lets look at the entire state as a whole

# Remove Inf
COElkDraw <- filter(COElkDrawAll, is.finite(Draw_Success) & !is.na(Draw_Success))
# Cap success to 100%
COElkDraw$Draw_Success[COElkDraw$Draw_Success>1] <- 1.00

By Year

DrawSuccessStatewide <- summarise(group_by(COElkDraw,Year),
                           Draw_Success = mean(Draw_Success,na.rm = T))

ggplot(DrawSuccessStatewide, aes(Year,Draw_Success)) +
  geom_bar(stat="identity") +
  scale_y_continuous(labels = percent) +
  coord_cartesian(ylim = c(.65,.90)) +
  labs(title="Statewide Elk Hunter Draw Success", caption="source: cpw.state.co.us")

Look at this trend. Definitely getting harder to draw each year.

By Hunting Season

DrawSuccessStatewide.Season <- dplyr::summarise(group_by(COElkDraw,Season),
                                         Draw_Success = mean(Draw_Success,na.rm = T))

ggplot(DrawSuccessStatewide.Season, aes(Season,Draw_Success)) +
  geom_bar(stat="identity") +
  scale_y_continuous(labels = percent) +
  coord_cartesian(ylim = c(.65,.90)) +
  labs(title="Statewide Elk Hunter Draw Success by Season", caption="source: cpw.state.co.us")

Fourth season has better draw success than the others.

Is this because there are less licenses? or more applicants? Well we saw that the number of hunters each year is fairly consistent. # Applicants per year

DrawApplicantsStatewide <- summarise(group_by(COElkDraw,Year),
                                     Draw_Applicants = sum(Ttl_Chce_1,na.rm = T))

ggplot(DrawApplicantsStatewide, aes(Year,Draw_Applicants)) +
  geom_bar(stat="identity") +
  # scale_y_continuous(labels = percent) +
  coord_cartesian(ylim = c(75000,110000)) +
  labs(title="Statewide Elk Hunter Draw Applicants", caption="source: cpw.state.co.us")

The number of applicants is now at the levels from 2006, after dropping off for several years by 12,000. Could be economic related.

Quota per year

DrawQuotaStatewide <- summarise(group_by(COElkDraw,Year),
                                     Quota = sum(Orig_Quota,na.rm = T))

ggplot(DrawQuotaStatewide, aes(Year,Quota)) +
  geom_bar(stat="identity") +
  # scale_y_continuous(labels = percent) +
  # coord_cartesian(ylim = c(75000,110000)) +
  labs(title="Statewide Elk Hunter Draw Quota", caption="source: cpw.state.co.us")

Yearly Draw Success by Unit

I’d like to know the distribution of Draw success across the state.

run script to get unit boundaries so we can draw them on a map

source('~/_code/colorado-dow/datasets/coordinate locations of cpw hunt units.R', echo=F)
## OGR data source with driver: ESRI Shapefile 
## Source: "/Users/psarnow/_code/colorado-dow/datasets/CPW_GMUBoundaries/BigGameGMUBoundaries03172015.shp", layer: "BigGameGMUBoundaries03172015"
## with 185 features
## It has 12 fields
## Integer64 fields read as strings:  GMUID

Get a statemap with some roads on it

roaddata <- rgdal::readOGR("~/_code/colorado-dow/datasets/ne_10m_roads/ne_10m_roads.shp")
## OGR data source with driver: ESRI Shapefile 
## Source: "/Users/psarnow/_code/colorado-dow/datasets/ne_10m_roads/ne_10m_roads.shp", layer: "ne_10m_roads"
## with 56601 features
## It has 29 fields
## Integer64 fields read as strings:  scalerank question
USAroads <- roaddata %>% subset(.,sov_a3 == "USA" & type == "Major Highway")
# I need to convert to data frames so that I can use the data with ggplot2.
USAroads <- fortify(USAroads)
Unitboundaries <- shapefile %>% fortify(region = "GMUID")

Unitboundaries2 <- merge(Unitboundaries, shapefile@data, by.x = 'id', by.y = 'GMUID')
Unitboundaries2$Unit <- as.character(Unitboundaries2$id)

# get min/max of long/lat for zooming
longset <- c(min(Unitboundaries2$long),max(Unitboundaries2$long))
latset <- c(min(Unitboundaries2$lat),max(Unitboundaries2$lat))
COroads <- filter(USAroads, long > longset[1] & long < longset[2])
COroads <- filter(COroads, lat > latset[1] & lat < latset[2])

DrawSuccess <- dplyr::summarise(group_by(COElkDraw,Year, Unit),
                                Draw_Success = mean(Draw_Success,na.rm = T))

Year2017 <- filter(DrawSuccess, Year == "2017")
DrawSuccesstoPlot <- left_join(Unitboundaries2,Year2017, by=c("Unit"))
ggplot(DrawSuccesstoPlot, aes(long, lat, group = group)) + 
  geom_polygon(aes(fill = Draw_Success),colour = "grey50", size = .2) + #Unit boundaries
  geom_path(data = COroads,aes(x = long, y = lat, group = group), color="#3878C7",size=2) + #Roads
  geom_text(data=data_centroids,aes(x=longitude,y=latitude,label = Unit),size=3) + #Unit labels
  scale_fill_distiller(palette = "YlOrBr",direction = 1,na.value = 'grey') +
  xlab("") + 
  ylab("") +
  theme(panel.background = element_rect(fill='white')) +
  theme(panel.grid.major= element_blank()) +
  theme(panel.grid.minor= element_blank()) +
  labs(title="2017 Colorado Hunter Draw Success", caption="source: cpw.state.co.us")

Conclusion

How about breakdowns for each sex? Bull, Cow, Either. What about seeing these for Hunters, Success, Draw, etc